<?php
include_once("adminBase.php");

class Customer extends AdminBase{
	function del()
	{
		$id = $_REQUEST['id'];
		$sql = " UPDATE	`tbl_user` SET status = '1',delete_time=CURRENT_TIMESTAMP WHERE id ='".$id."'";
		$this->db->query($sql);

		$this->managerLog($id, 'tbl_user');

		echo 'ok';die;
	}


	function index()
	{
		global $array_number;
		$sql = "select tu.*,(select count(te.id) from `tbl_estimate` te where te.user_id=tu.user_id)as count from `tbl_user` tu where tu.status='0'";
		$this->db->setQuery($sql);
		$data = $this->db->loadList();
		
		$this->smarty->assign("array_number",$array_number);
		$this->smarty->assign("row",$data);
		adminDisplay("admin_user.tpl");
	}
}

$customer = new Customer();